<?php

namespace App\Admin\Actions\Player;

use App\Models\Player;
use Dcat\Admin\Actions\Response;
use Dcat\Admin\Grid\RowAction;

class UpgradePoster extends RowAction
{
    protected string $title = '更新海报';

    public function handle(): Response
    {
        $player = Player::ofAdmin()->find($this->getKey());
        $player->updatePoster();

        return $this->response()->success('任务已提交，请稍候查看')->refresh();
    }
}
